package io;

import java.util.Arrays;
import java.util.Objects;

public class Person implements java.io.Serializable{
    String name;
    int age;
    String gender;
    String[] ontherInfo;

    public Person(String name, int age, String gender, String[] ontherInfo) {
        this.name = name;
        this.age = age;
        this.gender = gender;
        this.ontherInfo = ontherInfo;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getGender() {
        return gender;
    }

    public void setGender(String gender) {
        this.gender = gender;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public String[] getOntherInfo() {
        return ontherInfo;
    }

    public void setOntherInfo(String[] ontherInfo) {
        this.ontherInfo = ontherInfo;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Person person = (Person) o;
        return age == person.age && Objects.equals(name, person.name) && Objects.equals(gender, person.gender) && Objects.deepEquals(ontherInfo, person.ontherInfo);
    }

    @Override
    public int hashCode() {
        return Objects.hash(name, age, gender, Arrays.hashCode(ontherInfo));
    }

    @Override
    public String toString() {
        return "Person{" +
                "name='" + name + '\'' +
                ", age=" + age +
                ", gender='" + gender + '\'' +
                ", ontherInfo=" + Arrays.toString(ontherInfo) +
                '}';
    }
}
